package com.example.yunnan.service;

import com.example.yunnan.dao.recomDao;
import com.example.yunnan.pojo.recom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class recomService {
    @Autowired
    recomDao recomDao;


    public List<recom> list() {
        /*asc顺序排序*/
        Sort sort = new Sort(Sort.Direction.ASC, "id");
        return recomDao.findAll(sort);
    }

    public void addOrUpdate(recom recom) {
        recomDao.save(recom);
    }



}

